package com.example.demo.service;

import com.example.demo.entity.ServiceContent;
import com.example.demo.mapper.ServiceContentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ServiceContentService {
    @Autowired
    private ServiceContentMapper serviceContentMapper;
    public List<ServiceContent> findAll() {
        return serviceContentMapper.serviceAll();
    }
    public void update( ServiceContent serviceContent) {
        serviceContentMapper.updateServiceContent(serviceContent);
        System.out.println(serviceContent.getId());
    }
    public ServiceContent findById(Long id) {
        return serviceContentMapper.selectByPrimaryKey(id);
    }
        public String save(ServiceContent serviceContent) {
        serviceContentMapper.setServiceContent(serviceContent);
            return String.valueOf(serviceContent.getId());
    }
}

